package com.softWang.file.controller;

import com.softWang.file.service.FileManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiIgnore
@Validated
@RestController
@RequestMapping("/file/download")
public class DownFileContoller {
    @Resource
    private FileManageService fileManageService;


    @GetMapping("/downFile")
    public void downFile(@NotNull Long fileId, HttpServletResponse response)throws Exception{
        fileManageService.downFile(fileId,response);
    }


}
